package August;

import java.util.Scanner;
import java.util.Stack;

public class Day0829 {
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String str = scanner.nextLine();

            StringBuilder res = new StringBuilder();

            String[] strings = str.split("_");

            for (int i = 0; i < strings.length ; i++) {
                if (i == 0)
                    res.append(strings[i]);
                else
                    res.append(strings[i].substring(0,1).toUpperCase()+strings[i].substring(1));
            }
            System.out.println(res);
        }
    }


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()){
            String str = scanner.nextLine();
            String[] strings = str.split("[^a-zA-Z]+");
            StringBuilder stringBuilder = new StringBuilder();


            for (int i = strings.length-1; i >= 0; i--) {
                stringBuilder.append(strings[i]+" ");
            }
            System.out.println(stringBuilder.toString().trim());
        }
    }
}
